package com.xyyhome.web.love.domain;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by ty850 on 2017/5/21.
 */
@Entity
@Table(name = "y_l_dynamic", schema = "xyyhome", catalog = "")
public class YLDynamic {
    private String yldId;
    private String yldPandectId;
    private String yldUserId;
    private String yldContent;
    private Timestamp yldCreateTime;
    private Byte yldState;
    private Byte yldLoveValue;
    private Byte yldType;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "yld_id", nullable = false, length = 36)
    public String getYldId() {
        return yldId;
    }

    public void setYldId(String yldId) {
        this.yldId = yldId;
    }

    @Basic
    @Column(name = "yld_pandect_id", nullable = true, length = 36)
    public String getYldPandectId() {
        return yldPandectId;
    }

    public void setYldPandectId(String yldPandectId) {
        this.yldPandectId = yldPandectId;
    }

    @Basic
    @Column(name = "yld_user_id", nullable = true, length = 36)
    public String getYldUserId() {
        return yldUserId;
    }

    public void setYldUserId(String yldUserId) {
        this.yldUserId = yldUserId;
    }

    @Basic
    @Column(name = "yld_content", nullable = true, length = 1000)
    public String getYldContent() {
        return yldContent;
    }

    public void setYldContent(String yldContent) {
        this.yldContent = yldContent;
    }

    @Basic
    @Column(name = "yld_create_time", nullable = true)
    public Timestamp getYldCreateTime() {
        return yldCreateTime;
    }

    public void setYldCreateTime(Timestamp yldCreateTime) {
        this.yldCreateTime = yldCreateTime;
    }

    @Basic
    @Column(name = "yld_state", nullable = true)
    public Byte getYldState() {
        return yldState;
    }

    public void setYldState(Byte yldState) {
        this.yldState = yldState;
    }

    @Basic
    @Column(name = "yld_love_value", nullable = true)
    public Byte getYldLoveValue() {
        return yldLoveValue;
    }

    public void setYldLoveValue(Byte yldLoveValue) {
        this.yldLoveValue = yldLoveValue;
    }

    @Basic
    @Column(name = "yld_type", nullable = true)
    public Byte getYldType() {
        return yldType;
    }

    public void setYldType(Byte yldType) {
        this.yldType = yldType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        YLDynamic ylDynamic = (YLDynamic) o;

        if (yldId != null ? !yldId.equals(ylDynamic.yldId) : ylDynamic.yldId != null) return false;
        if (yldPandectId != null ? !yldPandectId.equals(ylDynamic.yldPandectId) : ylDynamic.yldPandectId != null)
            return false;
        if (yldUserId != null ? !yldUserId.equals(ylDynamic.yldUserId) : ylDynamic.yldUserId != null) return false;
        if (yldContent != null ? !yldContent.equals(ylDynamic.yldContent) : ylDynamic.yldContent != null) return false;
        if (yldCreateTime != null ? !yldCreateTime.equals(ylDynamic.yldCreateTime) : ylDynamic.yldCreateTime != null)
            return false;
        if (yldState != null ? !yldState.equals(ylDynamic.yldState) : ylDynamic.yldState != null) return false;
        if (yldLoveValue != null ? !yldLoveValue.equals(ylDynamic.yldLoveValue) : ylDynamic.yldLoveValue != null)
            return false;
        if (yldType != null ? !yldType.equals(ylDynamic.yldType) : ylDynamic.yldType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = yldId != null ? yldId.hashCode() : 0;
        result = 31 * result + (yldPandectId != null ? yldPandectId.hashCode() : 0);
        result = 31 * result + (yldUserId != null ? yldUserId.hashCode() : 0);
        result = 31 * result + (yldContent != null ? yldContent.hashCode() : 0);
        result = 31 * result + (yldCreateTime != null ? yldCreateTime.hashCode() : 0);
        result = 31 * result + (yldState != null ? yldState.hashCode() : 0);
        result = 31 * result + (yldLoveValue != null ? yldLoveValue.hashCode() : 0);
        result = 31 * result + (yldType != null ? yldType.hashCode() : 0);
        return result;
    }
}
